package com.dd.ljzapplication.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.dd.ljzapplication.R;

import java.util.List;

/**
 * Created by LiJZ on 2016/10/21.
 */
public class TestAdapter extends BaseRVAdapter<String> {

	public TestAdapter(List<String> mListData, Context context) {
		super(mListData, context);
	}

	public TestAdapter(Context context) {
		super(context);
	}

	@Override
	public int getDisplayType(int postion) {
		return 0;
	}

	@Override
	public RecyclerView.ViewHolder onCreateDisplayHolder(ViewGroup parent, int viewType) {
		View view = mLayoutInflater.inflate(R.layout.item_recycler, parent, false);
		MyHolder holder = new MyHolder(view);
		return holder;
	}

	@Override
	public void onBindData(RecyclerView.ViewHolder holder, int position) {
		((MyHolder) holder).textView.setText(mListData.get(position));
	}

	static class MyHolder extends RecyclerView.ViewHolder {

		TextView textView;

		public MyHolder(View itemView) {
			super(itemView);
			textView = (TextView) itemView.findViewById(R.id.tv);
		}
	}

}
